﻿<!doctype html>
<html>
<head>
    <title>微街秀 > 新发广告</title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
        <link href="plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/css.css" />
    <script src="js/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="js/base.js" type="text/javascript"></script>
    <script src="js/ajax-data.js" type="text/javascript"></script>
    <script src="js/dialog.js" type="text/javascript"></script>
    <style>
    .search{width: 100%;height: 50px;border-bottom: #ccc 1px solid;}
    .Query{width: 93%;height: 40px;border:1px solid #F37B0B;margin-left: auto;margin-right: auto;margin-top: 14px;-webkit-border-radius: 10px;position: relative;}
    .Stext{height: 30px;width: 75%;border: 0;color: #AAAAAA;font-size: 14px;line-height: 30px;margin-top: 3px;margin-left: 8px;}
    .searchico{width: 40px;float: right;height: 40px;background: #F37B0B;border-bottom-right-radius: 5px;border-top-right-radius: 5px;}
    .searchico img{width: 25px;margin: 9px;}
    .Advrtcent{width: 93%;height: 80px;text-align: left;border:1px solid #EAEAEA;margin: 20px auto 0 auto;position: relative;}
    .Advrtcent img{position: absolute;right: 15px;top: 30px;}
    .clr{color: #8F8F8F;font-size: 12px;}
    .Textclr{padding-top: 20px;line-height: 17px;padding-left: 10px;}
    </style>
    <script type="text/javascript">
        function login() {
            if (!islogin()) {
                window.location.href = 'login.html';
                return false;
            }
            return true;
        }   
    </script>
</head>
<body>
    <div id="pubwam">
        <div class="wamtop">
            <div class="topcententxt">发布</div>
            <div class="topleft" onclick="window.location.href='publish.html'"><img src="img/14.png"></div>
        </div>
      
      <div class="search">
            <div class="Query">
                <input type="text" class="Stext" id="Stext" placeholder="粘贴外部广告链接">
                <div class="searchico" id="searchico" onclick="search()">
                    <img src="img/Makeimg/24.png">
                </div>
            </div>
        </div>

        <div>
            <div class="Advrtcent" onclick="go('MakeAddSelect.html?source=1')">
                <div class="Textclr">
                    <span style="font-weight: bold">选择广告</span>
                    <p class="clr">
                        可以选择微街秀中已经发布的广告文章！</p>
                </div>
                <img src="img/45.png">
            </div>
            <div class="Advrtcent" onclick="go('articleadd_2_1.html')">
                <div class="Textclr">
                    <span style="font-weight: bold">新发广告</span>
                    <p class="clr">
                        可以编辑新的广告文章,</p>
                    <p class="clr">
                        包括：主题、头图、正文、广告图片！</p>
                </div>
                <img src="img/45.png">
            </div>
            <div style="width: 93%; margin: 10px auto 50px auto; color: #8F8F8F; line-height: 22px;">
                <div>
                    说明：</div>
                <div>
                    1、不得利用微街秀制作、上载、复制、发布、传播和转载危害国家安全、祖国统一、社会稳定的内容，或侮辱诽谤、涉黄、涉毒、暴力、引起他人不安及任何违反国家法律法规政策的内容。
                </div>
                <div>
                    2、微街秀有权对文章使用微街秀的情况进行审查和监督，如会员在使用微街秀时违反任何上述规定，微街秀有权要求会员主改正或直接采取一切必要的措施（包括但不限于更改或删除广告主张贴的内容、暂停或终止会员使用微街秀的权利，以及没收微街秀账户的费用并不予以退还，且不作任何补偿）。
                </div>
            </div>
        </div>
    </div>

        <div class="backimg-panl buzhou hide" onclick="NextBZ(1)">
        <div class="font-content" style="    margin-top: 10%;">
            <img src="img/buzhou/6_2.png" />
            <div class=" text-center" style="margin-top: -60px;">
                <p>
                    可粘贴外部链接</p>
                <p>
                    进行广告设置</p>                     
                      
            </div>
        </div>
    </div>

     <div class="backimg-panl buzhou hide" onclick="NextBZ(2)">
        <div class="font-content" style="bottom: 50%;">
            <img src="img/buzhou/6_3.png" />
            <div class=" text-center" style="margin-top: -60px;">
                <p>可选择微街秀中</p>
                <p>已经发布的广告文章</p>                     
                  
            </div>
        </div>
    </div>

     <div class="backimg-panl buzhou hide" >
        <div class="font-content" style="bottom: 30%;">
            <img src="img/buzhou/6_4.png" />
            <div class=" text-center" style="margin-top: -60px;">
                <p>
                    可以编辑</p>
                <p>
                    新的广告文章</p>                     
                     <button class=" btn btn-color btn-default " onclick=" SetBZ(62)">
                     知道了</button>
            </div>
        </div>
    </div>


     <script>
         ShowBZ(62);
         function search() {
             var url = document.getElementById("Stext").value;
             if (url == "") {
                 Alert("请输入网址");
                 return;
             }

             if (url.indexOf(window.location.host) != -1) {
                 Alert("不允许分享内部网页");
                 return;
             }

             url = url.replace("#wechat_redirect", "");  //处理微信链接不显示广告位
             var reg = new RegExp("[a-zA-z]+://[^\\s]*", "gi"); //匹配链接地址
             var result = url.match(reg);
             console.log(result);
            
             if (null == result || 0 == result.length) {
                 Alert("无效的文章链接地址");
                 return;
             }
             url = result[0];
             $.post("/Client/Ajax/HttpSource.ashx?GetRawUrl", { url: url }, function (data) {
                 wait.dismiss();
                 console.log(data);
                 if (data.code == 0) {
                     url = data.item;
                     if (!check()) return;
                     window.location.href = "url-edit.html?url=" + encodeURIComponent(url);

                 }
                 else {
                     toast.show(data.msg);
                 }

             }, "json");
             
         }

         function go(url) {
             if (!check()) return;
             window.location.href = url;
         }

         function check() {
             if (!islogin()) { window.location.href = "login.html"; }
             AjaxStart("ajax/advert.ashx?getcount", "", function (data) {
                 if (data.code == 0) {
                     if (data.item == null || data.item < 1) {
                         Alert("请先上传广告图片")
                         setTimeout(function () { window.location.href = 'advertisting.html' }, 1000);
                         return false;
                     }
                 }
             });
             return true;
         }
    </script>

</body>
</html>
